// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_pr.p_app;

import android.app.Application;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.os.Build;
import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import android.view.Display;
import android.view.WindowManager;
import com.nnee.p_d.cls_c;
import com.nnee.p_e.cls_b;
import com.nnee.p_fk.cls_l;
import com.nnee.p_i.cls_c;
import com.nnee.p_pr.p_a.cls_q;
import com.nnee.p_pr.p_a.cls_t;
import com.nnee.p_pr.p_a.cls_u;
import com.nnee.p_pr.p_activity.cls_PRISServiceOfflineDownload;
import com.nnee.p_pr.p_activity.di;
import com.nnee.p_pr.p_b.cls_a;
import com.nnee.p_pr.p_prot.cls_d;
import com.nnee.p_pr.cls_v;
import com.nnee.p_up.cls_CheckVersionService;
import dalvik.system.VMRuntime;
import java.io.File;
import java.util.ArrayList;
import java.util.LinkedList;

// Referenced classes of package com.nnee.p_pr.app:
//            c, d, f, a, 
//            b

public class cls_PrisApp extends Application
{

    public cls_PrisApp()
    {
        d = null;
        e = null;
        f = null;
        a = null;
        h = false;
        k = null;
        l = new ArrayList();
        n = new com.nnee.p_pr.p_app.cls_c(this);
    }

    private void C()
    {
        com.nnee.p_e.cls_b.a(i).a();
    }

    private void D()
    {
        Intent intent = new Intent(this, com.nnee.p_pr.p_activity.cls_PRISServiceOfflineDownload.class);
        startService(intent);
        bindService(intent, n, 1);
    }

    static cls_PRISServiceOfflineDownload a(cls_PrisApp paramprisapp)
    {
        return paramprisapp.k;
    }

    static cls_PRISServiceOfflineDownload a(cls_PrisApp paramprisapp, cls_PRISServiceOfflineDownload paramPRISServiceOfflineDownload)
    {
    	paramprisapp.k = paramPRISServiceOfflineDownload;
        return paramPRISServiceOfflineDownload;
    }

    public static cls_PrisApp a()
    {
        if(i == null)
            throw new NullPointerException("app not create should be terminated!");
        else
            return i;
    }

    static boolean a(cls_PrisApp paramprisapp, boolean flag)
    {
    	paramprisapp.m = flag;
        return flag;
    }

    static ArrayList b(cls_PrisApp paramprisapp)
    {
        return paramprisapp.l;
    }

    public String A()
    {
        return getSharedPreferences("PRISSharePrefs", 0).getString("skin", getPackageName());
    }

    public cls_l B()
    {
    	cls_l l1 = new cls_l();
        l1.c(getResources().getString(0x7f0a0217));
        l1.b("internal.skin.black");
        l1.a(true);
        l1.b("internal.skin.black".equals(A()));
        l1.a(null);
        return l1;
    }

    public void a(Handler handler, Runnable runnable)
    {
        Message message = Message.obtain(handler, runnable);
        if(!v()) goto _L2; else goto _L1
_L1:
        message.sendToTarget();
_L4:
        return;
_L2:
        x();
        ArrayList arraylist = l;
        arraylist;
        JVM INSTR monitorenter ;
        l.add(message);
        if(true) goto _L4; else goto _L3
_L3:
    }

    public void a(com.nnee.p_pr.p_atom.cls_u u1)
    {
        b = u1;
    }

    public void a(com.nnee.p_pr.p_offline.cls_e e1)
    {
        if(k != null)
            k.a(e1);
    }

    public void a(cls_d d1)
    {
        if(f != null)
            f = null;
        f = d1;
    }

    public void a(String s1)
    {
        getSharedPreferences("PRISSharePrefs", 0).edit().putString("skin", s1).commit();
    }

    public void a(String s1, String s2, String s3)
    {
        int i1 = 0;
        if(s2 != null && s3 != null) goto _L2; else goto _L1
_L1:
        File afile[];
        return;
_L2:
        if((afile = (new File(s1)).listFiles()) == null)
            continue; /* Loop/switch isn't completed */
        if(!s2.equals("*") || !s3.equals("*"))
            break; /* Loop/switch isn't completed */
        int k1 = afile.length;
        while(i1 < k1) 
        {
            File file1 = afile[i1];
            if(!file1.isDirectory())
                file1.delete();
            i1++;
        }
        if(true) goto _L1; else goto _L3
_L3:
        int j1 = afile.length;
        while(i1 < j1) 
        {
            File file = afile[i1];
            if(!file.isDirectory())
                if(s2.equals("*") && file.getName().endsWith((new StringBuilder()).append(".").append(s3).toString()))
                    file.delete();
                else
                if(s3.equals("*") && file.getName().startsWith(s2))
                    file.delete();
                else
                if(file.getName().startsWith(s2) && file.getName().endsWith((new StringBuilder()).append(".").append(s3).toString()))
                    file.delete();
            i1++;
        }
        if(true) goto _L1; else goto _L4
_L4:
    }

    public void a(ArrayList arraylist)
    {
        if(arraylist != null && arraylist.size() > 0)
        {
            g = arraylist;
            h = true;
        }
    }

    public void a(LinkedList linkedlist)
    {
        if(a != null)
            a = null;
        a = linkedlist;
    }

    public boolean a(Handler handler)
    {
        a(handler, ((Runnable) (new com.nnee.p_pr.p_app.cls_d(this))));
        return true;
    }

    public void b(com.nnee.p_pr.p_offline.cls_e e1)
    {
        if(k != null)
            k.b(e1);
    }

    public void b(cls_d d1)
    {
        if(d1 != null && d != null)
        {
            d.k();
            d = null;
        }
        d = d1;
    }

    public boolean b()
    {
        boolean flag;
        if(Build.DISPLAY != null && Build.DISPLAY.contains("simenxie"))
            flag = true;
        else
            flag = false;
        return flag;
    }

    public void c(cls_d d1)
    {
        if(e != null)
        {
            e.k();
            e = null;
        }
        e = d1;
    }

    public boolean c()
    {
        return true;
    }

    public ArrayList d()
    {
        return g;
    }

    public boolean e()
    {
        return h;
    }

    public void f()
    {
        g.clear();
        g = null;
        h = false;
    }

    public void g()
    {
        if(com.nnee.p_pr.p_a.cls_e.a())
            a(Environment.getExternalStorageDirectory().toString(), "*", "txt");
    }

    public void h()
    {
        String s1 = i();
        if(s1 != null)
            a(s1, "*", "*");
    }

    public String i()
    {
        String s1;
        if(com.nnee.p_pr.p_a.cls_e.a())
        {
            s1 = (new StringBuilder()).append(Environment.getExternalStorageDirectory().toString()).append("/pris/image/").toString();
            File file = new File(s1);
            if(!file.exists())
                file.mkdirs();
        } else
        {
            s1 = (new StringBuilder()).append(getCacheDir().getPath()).append("/").toString();
        }
        return s1;
    }

    public boolean j()
    {
        return com.nnee.p_pr.p_a.cls_u.e(this);
    }

    public String k()
    {
        Object aobj[] = new Object[5];
        aobj[0] = com.nnee.p_pr.p_a.cls_e.b(a().getApplicationContext());
        aobj[1] = com.nnee.p_pr.a.u.m(this);
        aobj[2] = com.nnee.p_pr.p_a.cls_q.b();
        aobj[3] = com.nnee.p_pr.a.u.r(this);
        aobj[4] = "1.0.1";
        return String.format("pris/%s (%s; android; %s; %s; android) %s", aobj);
    }

    public String l()
    {
        return com.nnee.p_pr.a.u.g(this);
    }

    public d m()
    {
        return f;
    }

    public LinkedList n()
    {
        return a;
    }

    public void o()
    {
        if(d != null)
        {
            d.k();
            d = null;
        }
    }

    public void onCreate()
    {
        long l1 = System.currentTimeMillis();
        super.onCreate();
        i = this;
        VMRuntime.getRuntime().setTargetHeapUtilization(0.75F);
        Thread.setDefaultUncaughtExceptionHandler(new cls_f(this));
        com.nnee.p_d.cls_c.a(this);
        com.nnee.p_g.cls_b.a(getPackageName(), "");
        C();
        new com.nnee.d.b(this);
        com.nnee.p_pr.p_b.cls_a.d(System.currentTimeMillis());
        com.nnee.p_b.p_a.cls_d.h().a(this);
        com.nnee.p_b.p_a.cls_d.h().a(new di());
        com.nnee.p_pr.p_d.cls_c.a(com.nnee.p_pr.p_b.cls_a.b());
        com.nnee.p_b.p_a.cls_d.h().a(com.nnee.p_pr.p_b.cls_a.c(), com.nnee.p_pr.p_b.cls_a.g());
        com.nnee.p_b.p_a.cls_d.h().a(com.nnee.p_pr.p_b.cls_a.d());
        com.nnee.p_pr.cls_v.a().q();
        com.nnee.p_pr.p_d.cls_c.a(this);
        com.nnee.p_b.p_a.cls_d.h().m();
        com.nnee.p_pr.p_d.cls_c.a(System.currentTimeMillis() - l1);
    }

    public void onTerminate()
    {
        super.onTerminate();
    }

    public cls_d p()
    {
        return d;
    }

    public com.nnee.p_pr.p_atom.cls_u q()
    {
        return b;
    }

    public d r()
    {
        return e;
    }

    public void s()
    {
        com.nnee.p_pr.p_d.cls_c.a(false);
        com.nnee.p_b.p_a.cls_d.h().j();
        com.nnee.p_img.cls_d.a().c();
        com.nnee.p_e.cls_b.a(i).b();
        if(k != null)
        {
            k.stopSelf();
            k = null;
        }
        stopService(new Intent(this, com/netease/update/CheckVersionService));
        (new Handler()).postDelayed(new com.nnee.p_pr.app.a(this), 1000L);
    }

    public int t()
    {
        int i1;
        cls_t t1;
        i1 = 0;
        t1 = com.nnee.p_pr.p_a.cls_u.c(this);
        com.nnee.p_pr.app.b.a[t1.ordinal()];
        JVM INSTR tableswitch 1 6: default 52
    //                   1 54
    //                   2 54
    //                   3 59
    //                   4 64
    //                   5 52
    //                   6 52;
           goto _L1 _L2 _L2 _L3 _L4 _L1 _L1
_L1:
        return i1;
_L2:
        i1 = 2;
        continue; /* Loop/switch isn't completed */
_L3:
        i1 = 1;
        continue; /* Loop/switch isn't completed */
_L4:
        i1 = 3;
        if(true) goto _L1; else goto _L5
_L5:
    }

    /**
     * @deprecated Method u is deprecated
     */

    public void u()
    {
        this;
        JVM INSTR monitorenter ;
        if(m)
        {
            if(v())
            {
                k.b();
                unbindService(n);
                k = null;
            }
            stopService(new Intent(this, com.nnee.p_pr.p_activity.cls_PRISServiceOfflineDownload.class));
            m = false;
        }
        this;
        JVM INSTR monitorexit ;
        return;
        Exception exception;
        exception;
        throw exception;
    }

    public boolean v()
    {
        boolean flag;
        if(k != null)
            flag = true;
        else
            flag = false;
        return flag;
    }

    public cls_PRISServiceOfflineDownload w()
    {
        return k;
    }

    /**
     * @deprecated Method x is deprecated
     */

    public void x()
    {
        this;
        JVM INSTR monitorenter ;
        if(!m && k == null)
        {
            D();
            m = true;
        }
        this;
        JVM INSTR monitorexit ;
        return;
        Exception exception;
        exception;
        throw exception;
    }

    public boolean y()
    {
        boolean flag;
        if(m && !v())
            flag = true;
        else
        if(!v())
            flag = false;
        else
            flag = k.c();
        return flag;
    }

    public int[] z()
    {
        Display display = ((WindowManager)getApplicationContext().getSystemService("window")).getDefaultDisplay();
        int ai[] = new int[2];
        ai[0] = display.getWidth();
        ai[1] = display.getHeight();
        return ai;
    }

    public static final String c = "/pris/image/";
    private static cls_PrisApp i;
    private static final float j = 0.75F;
    LinkedList a;
    com.nnee.p_pr.p_atom.cls_u b;
    private cls_d d;
    private cls_d e;
    private cls_d f;
    private ArrayList g;
    private boolean h;
    private cls_PRISServiceOfflineDownload k;
    private ArrayList l;
    private boolean m;
    private ServiceConnection n;
}
